import request from '/@/utils/request';

/**
 * 用户登录
 * @param params 要传的参数值
 * @returns 返回接口数据
 * 订单api接口集合
 * @method signIn 获取订单
 */
export function useOrderApi() {
	return {
		getOrderList: (params) => {
			return request({
				url: '/order/order/admin/page',
				method: 'post',
				data: params,
			});
		},
		getOrderListByReturnApply: (params) => {
			return request({
				url: '/order/orderReturnApply/admin/page',
				method: 'post',
				data: params,
			});
		},
		getOrderDetail: (params) => {
			return request({
				url: '/order/order/admin/detail',
				method: 'post',
				data: params,
			});
		},
		getOrderDetailByReturnApply: (params) => {
			return request({
				url: '/order/orderReturnApply/admin/detail',
				method: 'post',
				data: params,
			});
		},
		getRemarkList: (params) => {
			return request({
				url: '/order/orderReturnReason/admin/page',
				method: 'post',
				data: params,
			});
		},
		updateOrder: (params) => {
			return request({
				url: '/order/order/admin/updateOrder',
				method: 'post',
				data: params,
			});
		},
		addReturnGoodsReason: (params) => {
			return request({
				url: '/order/orderReturnReason/admin/insert',
				method: 'post',
				data: params,
			});
		},
		batchRefund: (params) => {
			return request({
				url: '/order/orderReturnReason/admin/insert',
				method: 'post',
				data: params,
			});
		},
		// 退货申请
		orderReturnApply: (params) => {
			return request({
				url: '/order/orderReturnApply/admin/save',
				method: 'post',
				data: params,
			});
		},
		orderReturnApplyUpdate: (params) => {
			return request({
				url: '/order/orderReturnApply/admin/update',
				method: 'post',
				data: params,
			});
		},
		// 支付管理
		getOrderPayPage: (params) => {
			return request({
				url: '/order/order/admin/pay/page',
				method: 'post',
				data: params,
			});
		},
	};
}
